﻿using System;

namespace Cookbook.Common
{
    public static class DateTimeExtensions
    {
        /// <summary>
        /// Removes the milliseconds and ticks of a <see cref="DateTime"/>.
        /// </summary>
        public static DateTime Truncate(this DateTime dateTime)
        {
            return new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second);
        }
    }
}
